package com.zzedu.app;

import jakarta.validation.Valid;
import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.NotNull;

/**
 * 请求参数基类
 *
 * @param <T>
 */
public class BaseRequest<T> {

    /**
     * 时间戳,从1970年1月1日00:00:00开始计算的毫秒数
     */
    @NotNull(message = "timestamp不能为空")
    private Long timestamp;

    /**
     * 随机字符串 1-32位之间
     */
    @NotBlank(message = "nonceStr不能为空")
    private String nonceStr;


    /**
     * 请求参数
     */
    @Valid
    @NotNull(message = "content不能为空")
    private T content;
    /**
     * 版本号
     */
    private String version;

    public Long getTimestamp() {
        return timestamp;
    }

    public void setTimestamp(Long timestamp) {
        this.timestamp = timestamp;
    }

    public T getContent() {
        return content;
    }

    public void setContent(T content) {
        this.content = content;
    }

    public String getNonceStr() {
        return nonceStr;
    }

    public void setNonceStr(String nonceStr) {
        this.nonceStr = nonceStr;
    }

    public String getVersion() {
        return version;
    }

    public void setVersion(String version) {
        this.version = version;
    }
}
